package com.edu.mapper;/*
 * @Author:lsx
 * @Date:2024/9/20--09--20--20:33
 *
 */

import com.edu.bean.Book;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface BookMapper {
    @Insert("insert into book(bookName,bookWriter,bookType) values(#{bookName},#{bookWriter},#{bookType})")
    int addBook(Book book);
    @Delete("delete from book where bookId = #{bookId}")
    int deleteBookById(int bookId);
    @Select("select * from book")
    List<Book> selectAllBook();
    @Select("select * from book where bookId = #{bookId}")
    Book selectBookById(int bookId);
    @Update("update book set bookName = #{bookName},bookWriter = #{bookWriter},bookType = #{bookType} where bookId = #{bookId}")
    int updateBookById(Book book);
}
